/*  
var box=['shihaiqing',18,'shanxi',new Date()];
alert(box);		//shihaiqing,18,shanxi,Mon Jan 21 2019 16:47:52 GMT+0800 (中国标准时间)
alert(box.toString());		//shihaiqing,18,shanxi,Mon Jan 21 2019 16:47:52 GMT+0800 (中国标准时间)		内置方法
alert(box.valueOf());		//shihaiqing,18,shanxi,Mon Jan 21 2019 16:47:52 GMT+0800 (中国标准时间)
alert(box.toLocaleString());		//shihaiqing,18,shanxi,2019/1/21 下午4:47:52
alert(box.run());		//报错 		Uncaught TypeError: box.run is not a function

var box=['shihaiqing',18,'shanxi',new Date()];
//alert(box.join('|'));			//方法运行过后返回按指定符号分割的字符串	shihaiqing|18|shanxi|Tue Jan 22 2019 00:38:29 GMT+0800 (中国标准时间)
//alert(typeof box.join('|'));			//string
alert(typeof box);					//object		原数组没有任何变化  类型还是object

var box=['shihaiqing',18,'shanxi'];
alert(box.push('计算机编程'));		//4		给数组末尾添加N个元素  并返回数组的最新长度
alert(box);		//shihaiqing,18,shanxi,计算机编程

var box=['shihaiqing',18,'shanxi'];
alert(box.push('计算机编程','nikanka'));		//5
alert(box);		//shihaiqing,18,shanxi,计算机编程,nikanka

var box=['shihaiqing',18,'shanxi'];
alert(box.push('计算机编程','nikanka'));		//5
alert(box);		//shihaiqing,18,shanxi,计算机编程,nikanka
alert(box.pop());		//nikanka		移除数组最后的元素  并且返回移除的元素
alert(box);			//shihaiqing,18,shanxi,计算机编程

var box=['shihaiqing',18,'shanxi'];
alert(box.push('计算机编程','nikanka'));		//5
alert(box);		//shihaiqing,18,shanxi,计算机编程,nikanka
alert(box.shift());		//shihaiqing     移除数组开头的元素，并返回这个元素
alert(box);				//18,shanxi,计算机编程,nikanka

var box=['shihaiqing',18,'shanxi'];
alert(box.unshift('计算机编程','nikanka'));		//5   数组前端添加N个元素，并且返回最新的长度
alert(box);		//计算机编程,nikanka,shihaiqing,18,shanxi

var box=[1,2,3,4,5];
alert(box.reverse());		//5,4,3,2,1
alert(typeof box.reverse());		//object
alert(box);		//1,2,3,4,5
alert(typeof box);	//object

var box=[1,2,3,5,4];
alert(box.reverse());		//4,5,3,2,1
alert(typeof box.reverse());		//object
alert(box);		//1,2,3,4,5
alert(typeof box);	//object

var box=[1,2,3,5,4];
alert(box.reverse());		//4,5,3,2,1		reverse方法  颠倒数组中元素的顺序
alert(typeof box.reverse());		//object
alert(box);		//1,2,3,4,5		//对值进行操作  引用么有变
alert(typeof box);	//object

var box=[4,1,6,2,7,3,9];
alert(box.sort());	//1,2,3,4,6,7,9		从小到大排序    
alert(box);		//1,2,3,4,6,7,9

var box=[0,1,5,10,15];
alert(box.sort());		//0,1,10,15,5

var box=['0','1','5','10','15'];
alert(box.sort());		//0,1,10,15,5

function compare(v1,v2){
	if(v1 < v2){
		return -1;
	}else if(v1>v2){
		return 1;
	}else{
		return 0;
	}
};
var box=[0,1,5,10,15];
alert(box.sort(compare));		//0,1,5,10,15

function compare(v1,v2){
	if(v1 < v2){
		return -1;
	}else if(v1>v2){
		return 1;
	}else{
		return 0;
	}
};
var box=['0','1','5','10','15'];
alert(box.sort(compare));		//0,1,10,15,5

//从大到小
function compare(v1,v2){
	if(v1 < v2){
		return 1;
	}else if(v1>v2){
		return -1;
	}else{
		return 0;
	}
};
var box=[0,1,5,10,15];
alert(box.sort(compare));		//15,10,5,1,0

//从大到小
function compare(v1,v2){
	if(v1 < v2){
		return 1;
	}else if(v1>v2){
		return -1;
	}else{
		return 0;
	}
};
var box=[0,1,5,10,15];
alert(box.sort(compare));		//15,10,5,1,0   如果要逆序   正序之后  用reverse更加方便

var box=['shihaiqing',18,'shanxi'];
var box2=box.concat('计算机编程');		//基于原数组创建一个新数组
alert(box2);		//shihaiqing,18,shanxi,计算机编程
alert(typeof box2);		//object
alert(box);		//shihaiqing,18,shanxi
alert(typeof box);		//object

var box=['shihaiqing',18,'shanxi'];
var box2=box.slice(1);
alert(box2);		//18,shanxi
alert(typeof box2);		//object
alert(box);		//shihaiqing,18,shanxi
alert(typeof box);		//object

var box=['shihaiqing',18,'shanxi','look','height'];
var box2=box.slice(1,3);//这里不是从第一个位置截取3个，而是从第一个取到第三个
alert(box2);		//18,shanxi
alert(typeof box2);		//object
alert(box);		//shihaiqing,18,shanxi
alert(typeof box);		//object

var box=['shihaiqing',18,'shanxi','look','height'];
var box2=box.splice(0);
alert(box2);		//shihaiqing,18,shanxi,look,height

var box=['shihaiqing',18,'shanxi','look','height'];
var box2=box.splice(1,2);		//从第一个元素开始取，取两个
alert(box2);		//18,shanxi

var box=['shihaiqing',18,'shanxi','look','height'];
var box2=box.splice(1,2);		//删除数组元素功能   从第一个元素开始取，取两个，而不是从第0个位置取到第二个位置
alert(box2);		//18,shanxi
alert(box);		//shihaiqing,look,height		原数组中只有剩下的元素了

var box=['shihaiqing',18,'shanxi','look','height'];
var box2=box.splice(1,1);		
alert(box2);		//18
alert(box);		//shihaiqing,shanxi,look,

var box=['shihaiqing',18,'shanxi','look','height'];
var box2=box.splice(1,0,'jiangsu','看看');		//添加新元素功能   从第一个插入点插入元素，0表示不删除
alert(box2);		//啥都没有
alert(box);		//shihaiqing,jiangsu,看看,18,shanxi,look,height
*/

var box=['shihaiqing',18,'shanxi','look','height'];
var box2=box.splice(1,2,'jiangsu','看看');		//替换数组元素功能  从第一个插入点插入元素，0表示不删除
alert(box2);		//18,shanxi
alert(box);		//shihaiqing,jiangsu,看看,look,height


















